package com.hospital.register.dto.user;

import com.hospital.register.constants.RegexConstants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@ApiModel(description = "接收验证码的参数")
public class VerificationCodeDto implements Serializable {

    @ApiModelProperty(value = "手机号")
    @NotNull(message = "手机号不可为空")
    @Pattern(regexp = RegexConstants.PHONE, message = "必须是11位手机号")
    private String phone;

    @ApiModelProperty(value = "密码")
    @NotNull(message = "验证码不可为空")
    @Pattern(regexp = RegexConstants.VERIFICATION_CODE, message = "验证码必须是4位或6位数字")
    private String code;

}
